<?php
global $header;
global $footer;
global $menu;
global $featureManager;
global $currentUser;
global $project_list;

$header['title'] = 'Web Dev Lab';
$header['page_id'] = 'projects';

#$featureManager->apply("com.yizin.platform.site.menu", $menu);
#$header['menu'] = $menu['html'];
$featureManager->apply("com.yizin.platform.site.header", $header);
$featureManager->apply("com.yizin.platform.site.footer", $footer);

?>
<?php echo $header['html']; ?>

<ul class="main-menu">
		<li class="current"><a href="<?php echo REQUEST_BASE;?>projects/">projects</a></li>
		<li><a href="<?php echo REQUEST_BASE;?>people/">people</a></li>
		<li ><a href="<?php echo REQUEST_BASE;?>seminars/">seminars</a></li>
	</ul>
</div>
<div id="main">
	<div class="main-wrapper">
		<h2 class="page-title"><a href="<?php echo REQUEST_BASE;?>projects/" class="projects">projects</a></h2>
		<div class="main-content">
			<?php 	foreach ($project_list as $project) {
				$basic_info = $project['basic_info']; 
							$title = $basic_info['title'];
				if (strlen($title) >55) {
					$title = substr($title, 0, 55);
					$sub_title = explode(' ', $title);
					if (count($sub_title) >= 2) {
						$title = '';
						for ($i = 0; $i <count($sub_title); $i++) {
							$title .= $sub_title[$i] . ' ';
						}
						$title = $title . ' ...';
					}
				}
			?>
			<div class="content-container list prj-box">
				<div class="main-info clearfix">
					
						<div class="image-info">
						<?php if ($basic_info['logo']) { ?>
							<img src="<?php echo RESOURCE_BASE .$basic_info['logo']; ?>" title="<?php echo $basic_info['title'];?>" alt="<?php echo $basic_info['title'];?>" />
						<?php } ?>	
						</div>
					
					<div class="text-info">
						<h4 class="name">
							<a href='<?php echo REQUEST_BASE; ?>projects/<?php echo $basic_info['short_title'];?>/' >
								<?php echo $title; ?>
							</a>
						</h4>
						<div class="misc">
							<p><?php echo $basic_info['start_time'] ; ?></p>
							<p>
								Owner: 
								<a href="<?php echo REQUEST_BASE?>people/<?php echo strtolower($basic_info['first_name']) . '_' . strtolower($basic_info['last_name']);?>/">
									<?php echo $basic_info['first_name'] . ' ' . $basic_info['last_name']; ?>
								</a>
							</p>
						</div>
					</div>
				</div>
			</div>
			<?php } ?>
		</div>
	</div>
				
</div>

<?= $footer['html'] ?>
